using System;
using System.Data;
using System.Linq;
using System.ComponentModel;
using System.Reflection;
using System.Collections.Generic;
using DataObject.Database;
using DataObject.Model;

public partial class PaymentBatchDetailMapper
	{
		#region ToEntity

		public static PaymentBatchDetail ToEntity(PaymentBatchDetail entity, PaymentBatchDetailDTO businessobject)
		{
			if (businessobject == null)
			{
				return null;
			}
			entity.Active = businessobject.Active;
			entity.Amount = businessobject.Amount;
			entity.CardType = businessobject.CardType;
			entity.CurrencyAmount = businessobject.CurrencyAmount;
			entity.CurrencyFee = businessobject.CurrencyFee;
			entity.Fee = businessobject.Fee;
			entity.FeeRate = businessobject.FeeRate;
			entity.PaymentBatchDetailID = businessobject.PaymentBatchDetailID;
			entity.PaymentBatchID = businessobject.PaymentBatchID;
			entity.PaymentMethod = businessobject.PaymentMethod;
			entity.Rate = businessobject.Rate;
			entity.ReceivedBy = businessobject.ReceivedBy;
			return entity;
		}

		#endregion

		#region ToBusinessObject

		public static PaymentBatchDetailDTO ToBusinessObject(PaymentBatchDetail entity)
		{
			if (entity == null)
			{
				return null;
			}
			return new PaymentBatchDetailDTO
			{
				Active = entity.Active,
				Amount = entity.Amount,
				CardType = entity.CardType,
				CurrencyAmount = entity.CurrencyAmount,
				CurrencyFee = entity.CurrencyFee,
				Fee = entity.Fee,
				FeeRate = entity.FeeRate,
				PaymentBatchDetailID = entity.PaymentBatchDetailID,
				PaymentBatchID = entity.PaymentBatchID,
				PaymentMethod = entity.PaymentMethod,
				Rate = entity.Rate,
				ReceivedBy = entity.ReceivedBy,
				PaymentBatch = PaymentBatchMapper.ToBusinessObject(entity.PaymentBatch)
			};
		}

		#endregion

		#region ToBusinessObjectHasChildren

		public static PaymentBatchDetailDTO ToBusinessObjectHasChildren(PaymentBatchDetail entity, params Type[] types)
		{
			if (entity == null)
			{
				return null;
			}
			PaymentBatchDetailDTO businessobject = new PaymentBatchDetailDTO
			{
				Active = entity.Active,
				Amount = entity.Amount,
				CardType = entity.CardType,
				CurrencyAmount = entity.CurrencyAmount,
				CurrencyFee = entity.CurrencyFee,
				Fee = entity.Fee,
				FeeRate = entity.FeeRate,
				PaymentBatchDetailID = entity.PaymentBatchDetailID,
				PaymentBatchID = entity.PaymentBatchID,
				PaymentMethod = entity.PaymentMethod,
				Rate = entity.Rate,
				ReceivedBy = entity.ReceivedBy,
				PaymentBatch = PaymentBatchMapper.ToBusinessObject(entity.PaymentBatch)
			};
			return businessobject;
		}

		#endregion

	}
